<template>
	<view class="daohang">
		<view class="inside" @click="change(index,item.id)" v-for="(item,index) in nav" :key="item.id" :class="{red:isred === index}">
			{{item.name}}
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isred:0,
				nav:[
					{
						name:'华语',
						id:7
					},
					{
						name:'欧美',
						id:96
					},
					{
						name:'韩国',
						id:16
					},
					{
						name:'日本',
						id:8
					}
				]
			}
		},
		methods:{
			change(index,id){
				this.isred = index
				this.$emit('change',id)
			}
		}
	}
</script>

<style lang="scss">
	.daohang{
		width: 100%;
		height: 100rpx;
		//background-color: yellow;
		display: flex;
		//align-items: center;
		justify-content: space-around;
		.inside{
			height: 100%;
			width: 20%;
			//background-color: red;
			display: flex;
			justify-content: center;
			align-items: center;
		}
		.red{
			color: $red;
			border-bottom: 2rpx solid $red;
		}
	}
</style>
